<?php
header("Content-Type:application/json;charset=utf-8");
header('Access-Control-Allow-Origin:*');
if (isset($_GET["username"])){
//1.接受到 浏览器往服务器传递的参数
$UTEL = $_GET["username"];
//2.创建数据库的连接对象
    $host = "127.0.0.1";
    $name = "root";
    $pwd = "";
    $db = "cs1804";
    $port = "3306";
    $conn = new mysqli($host, $name, $pwd, $db, $port);
    //3.设置连接的字符集 php=== mysql
    mysqli_query($conn,"set names utf8");
    //4.准备sql语句
    $sql = "SELECT*FROM userinfo WHERE utel='".$UTEL."'";
    //5.执行sql语句
    $reuslt = $conn->query($sql);
    //6.判断结果
    if ($reuslt->num_rows>=1){
        print_r("false");
    }else{
        print_r("true");
    }
    //7.关闭连接
    $conn->close();
}